#include <mockcpp/mockcpp.hpp>
#include <testngpp/testngpp.hpp>


USING_MOCKCPP_NS
USING_TESTNGPP_NS

#include <Unit.h>

FIXTURE(Unit)
{
	TEST(Amount can be converted to amount of base unit)
	{
		Unit mile(1760*3*12, "MILE");
		ASSERT_EQ(3*1760*3*12, mile.toAmountOfBaseUnit(3));
	}

	TEST(Amount of unit can be print)
	{
		unsigned int amount = 3*1760*3*12;
		unsigned int& unitAmount = amount;
		Unit mile(1760*3*12, "MILE");
		std::stringstream out;

		mile.printAmountPerUnit(out, unitAmount);
		ASSERT_EQ(std::string("3 MILE "), out.str());
	}
};
